package com.bjsxt.chapter9_decorator;

/**
 * @ClassName Client
 * @Description 客户端
 * @Author 黑马程序员
 * @Date 11:53 2024/6/22
 * @Version 1.0
 **/
public class Client {
    public static void main(String[] args) {
        Car car = new Car();
        car.move();

        System.out.println("-----增加飞行的功能-----");
        FlyCar flyCar = new FlyCar(car);
        flyCar.move();

        System.out.println("-----增加水里游的功能-----");
        WaterCar waterCar = new WaterCar(car);
        waterCar.move();

        System.out.println("-----增加飞行和水里游的功能-----");
        WaterCar waterCar2 = new WaterCar(flyCar);
        waterCar2.move();

        System.out.println("-----增加飞行、水里游和自动驾驶的功能-----");
        AICar aiCar = new AICar(new FlyCar(new WaterCar(new Car())));
        aiCar.move();
    }
}
